package com.magic.consumer.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MessageConfig {

    /**
     * simpleQueue
     * @return
     */
    @Bean
    public Queue objectQueue() {
        return new Queue("object.queue");
    }

    /**
     * lazyQueue
     * @return
     */
    //@Bean
    public Queue lazyQueue() {
        return QueueBuilder
                .durable("lazy.queue")
                .lazy() //开启Lazy模式
                .build();
    }

}